<html>
    <head>
        <meta charset="utf-8" />
        <title>新丝路明日之星选拔赛报名</title>
        <meta name="Keywords" content="新丝路,世界小姐,模特大赛,时尚周,模特培训,时尚,超模,模特,少儿模特大赛,时尚机构" />
        <meta name="description" content="新丝路时尚门户,MissWorld世界小姐大赛,中国模特大赛,少儿模特大赛,专业模特培训机构,超模摇篮,T台走秀" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
        <link type="text/css" rel="stylesheet" href="{CSS_PATH}nsr_qrcode/public.css">
        <link rel="stylesheet" type="text/css" href="{CSS_PATH}nsr_qrcode/chooseArea.css">
        <link rel="stylesheet" type="text/css" href="{CSS_PATH}nsr_qrcode/dyyqhy.css">
        <style>
        
    </style>

        <script type="text/javascript" src="{JS_PATH}html_reset_1080.js"></script>
        <script type="text/javascript" src="{JS_PATH}jquery.min.v2.1.3.js"></script>
		<script type="text/javascript" src="{JS_PATH}qrcode/jquery-1.11.1.js" ></script>
		<script type="text/javascript" src="{JS_PATH}qrcode/jquery.qrcode.js" ></script>
		<script type="text/javascript" src="{JS_PATH}qrcode/qrcode.js" ></script> 
		<script type="text/javascript" src="{JS_PATH}qrcode/utf.js" ></script>
    </head>
<body>
  <div class="container">
     <img class="banner" src="{IMG_PATH}pic4.jpg" alt="banner">
     <h4 class="yqhyfx">店员报名推广</h4>
     <div class="wrpWhite">
     <input type="hidden" name="regId" value="{$reg_id}" class="">
     <input type="hidden" name="source" value="{$source}" class="">
     <input type="hidden" name="channel" value="{$channel}" class="">
      <ul class="input-wrapper">
          <li>
              <p class="row-tit clearfix">
                  <span class="required-icon">*</span>
                  <span class="required-tit">您的姓名/Your name</span>
                  <i class="hiop" id="name-tip" style="display:none;">此项必填</i>
              </p>
              <div class="row-input">
                  <label>
                      <img class="tit-1" src="{IMG_PATH}pa.png">
                  </label>
                  <input name="shop_name" type="text" class="">
              </div>
              
          </li>
         
          <li>
              <p class="row-tit clearfix">
                  <span class="required-icon">*</span>
                  <span class="required-tit">您的手机号 /Your telephone</span>
                  <i class="hiop" id="tel-tip" style="display:none;">此项必填</i></p>
              <div class="row-input">
                  <label><img class="tit-4" src="{IMG_PATH}icon_4.png"></label>
                  <input name="tel" type="tel" class="" >
              
              </div>
          </li>
          
       </ul>
     </div>
     
          <a href="javascript:;" onclick="create_qrcode();" class="btn-commit_wa">生成邀请连接二维码</a>
          <div id="qrCodeDiv">
          </div>
  </div>
 
</body>
    <script src="{JS_PATH}area/pcasunzipmobo.js"></script>

    <script type="text/javascript">
        $(function(){
            $("#yz_popTanChuClose,#yz_popIframeDiv").click(function() {  
                $("#fn_area_pop").hide();   
            }); 
        })
    </script>
    <script>
        $(function(){
            setTimeout(function(){
                $(".fn_pop").hide();
            },3000);
        })
        $(function(){
            $(".fn_multiSelect>span").each(function(index){
                $(".fn_multiSelect>span>input").eq(index).attr("id","styled-checkbox-"+(index+1));
                $(".fn_multiSelect>span>label").eq(index).attr("for","styled-checkbox-"+(index+1));
            });
        })
    </script>
    <script type="text/javascript">
	    function qrcode(recommendId,rootId){
	    	var regId = $("input[name=regId]").val();
	    	var source = $("input[name=source]").val();
	    	var channel = $("input[name=channel]").val();
	    	var url = encodeURIComponent("http://m.emagsoftware.cn/xinsilu/weixin/toRegChildModel?regId="+regId+"&source="+source+"&channel="+channel+"&recommendId="+recommendId+"&rootId="+rootId);//二维码的内容
	    	$.ajax({
	    		type:"POST",
	    		url:"?m=content&c=index&a=qrcode_image",
	    		data:{"url":url},
	    		dataType:"HTML",
	    		success:function(result){
	    			$("#qrCodeDiv").html(result);
	    		}
	    	});
		}
    	function create_qrcode(){
    		var regId = $("input[name=regId]").val();
    		var name = $("input[name=shop_name]").val();
    		var tel = $("input[name=tel]").val();
    		var source = $("input[name=source]").val();
	    	var channel = $("input[name=channel]").val();
    		if(name==""||name=="undefined"){
    			$("#name-tip").show();
    			$("input[name=shop_name]").focus();
    			return false;
    		} else {
    			$("#name-tip").hide();
    		}
    		if(tel==""||tel=="undefined"){
    			$("#tel-tip").show();
    			$("input[name=tel]").focus();
    			return false;
    		} else {
    			if (!(/^1[34578]\d{9}$/.test(tel))) {
    				$("#tel-tip").html('手机号码有误,请重输').show();
    				$("input[name=tel]").focus();
    				return false;
    			}
    			$("#tel-tip").hide();
    		}
    		$.ajax({
    			type:"POST",
    			url:"?m=content&c=index&a=create_qrcode",
    			data:{"shop_name":name,"tel":tel,"regId":regId,"source":source,"channel":channel},
    			dataType:"JSON",
    			success:function(result){
    				if(result.code=="R0000000"){
        				var data = result.data;
        				var recommendId = data['id'];
        				var rootId = data['rootId'];
        				qrcode(recommendId,rootId);
    				} else if(result.code=="201"){
    					$("#tel-tip").html(result.info).show();
        				$("input[name=tel]").focus();
        				return false;
    				}
    			}
    		});
    	}
    </script>
</html>